import axios from 'axios'

// 获取绩效列表
export const getPerformanceList = (params) => {
    return axios.get('/api/performances', { params })
}

// 添加绩效记录
export const addPerformance = (data) => {
    return axios.post('/api/performances', data)
}

// 获取绩效详情
export const getPerformanceDetail = (id) => {
    return axios.get(`/api/performances/${id}`)
}

// 更新绩效信息
export const updatePerformance = (data) => {
    return axios.put(`/api/performances/${data.id}`, data)
}

// 获取绩效评估标准
export const getEvaluationCriteria = () => {
    return axios.get('/api/performance/criteria')
}

// Mock数据
export const getMockPerformanceList = () => {
    return Promise.resolve({
        data: {
            list: [
                {
                    id: 1,
                    employeeId: 'EMP001',
                    name: '张三',
                    department: '技术部',
                    position: '前端工程师',
                    evaluationPeriod: '2023-Q1',
                    overallScore: 85,
                    status: 1, // 1: 已评估, 2: 待评估
                    evaluator: '李经理',
                    evaluationDate: '2023-04-15'
                },
                // 更多示例数据...
            ],
            total: 15
        }
    })
}